#************************************************************************************* PROCEDURE global SEC_TO_ADOTIME real:secexp timeexp:reference # # transforming an amount of seconds into a TIME format string # # Input: <0> (real) # Output:<"00:000:00:00:00"> (string) # # since this procedure evaluates the amount of seconds using # the company specific times, the following two variables have # to be specified using the values from the library attributes. # like this: # # wdpy:251 # working days per year # whpd:7.7 # working hours per day # # For other purpose you may take the "normal" 360/24 duration # as well #************************************************************************************* { SET timeexp: ("") SET years: (floor(secexp/(60*60*whpd*wdpy))) SET secexp: (secexp-(years*(60*60*whpd*wdpy))) SET days: (floor(secexp/(60*60*whpd))) SET secexp: (secexp-(days*(60*60*whpd))) SET hours: (floor(secexp/(60*60))) SET secexp: (secexp-(hours*(60*60))) SET min: (floor(secexp/(60))) SET secexp: (secexp-(min*(60))) SET sec: (secexp) SET push:0 IF (years <10) {SET push:1} SET pushit:1 WHILE (pushit <= push) { SET timeexp: (timeexp + "0") SET pushit: (pushit+1) } SET timeexp: (timeexp + STR years+":") SET push:0 IF (days < 100) { SET push:1 IF (days < 10) { SET push:2 } } SET pushit:1 WHILE (pushit <= push) { SET timeexp: (timeexp + "0") SET pushit: (pushit+1) } SET timeexp: (timeexp + STR days+":") SET push:0 IF (hours < 10) {SET push:1} SET pushit:1 WHILE (pushit <= push) { SET timeexp: (timeexp + "0") SET pushit: (pushit+1) } SET timeexp: (timeexp + STR hours+":") SET push:0 IF (min < 10) {SET push:1} SET pushit:1 WHILE (pushit <= push) { SET timeexp: (timeexp + "0") SET pushit: (pushit+1) } SET timeexp: (timeexp + STR min+":") SET push:0 IF (sec < 10) {SET push:1} SET pushit:1 WHILE (pushit <= push) { SET timeexp: (timeexp + "0") SET pushit: (pushit+1) } SET timeexp: (timeexp + STR sec) } #*************************************************************************************